package com.manner.groupon.model.enums;

/**
 * 角色枚举
 */
public enum RoleEnums {

    ADMIN_ROLE(1, "管理员"),

    LIVE_ROLE(2, "直播人员"),

    STORE_ROLE(3, "商户"),

    STAFF_ROLE(4, "内部员工");


    private Integer id;


    private String name;

    RoleEnums(Integer id, String name) {
        this.id = id;
        this.name = name;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }


    public static RoleEnums getInstance(Integer id) {
        RoleEnums role = null;
        for (RoleEnums value : RoleEnums.values()) {
            if (value.id.equals(id)) {
                role = value;
                break;
            }
        }
        return role;
    }
}
